import request from '@/utils/request'

export function listTodo(query) {
  return request({
    url: '/system/todo/list',
    method: 'get',
    params: query
  })
}

export function getTodo(todoId) {
  return request({
    url: '/system/todo/' + todoId,
    method: 'get'
  })
}

export function addTodo(data) {
  return request({
    url: '/system/todo',
    method: 'post',
    data: data
  })
}

export function updateTodo(data) {
  return request({
    url: '/system/todo',
    method: 'put',
    data: data
  })
}

export function delTodo(todoId) {
  return request({
    url: '/system/todo/' + todoId,
    method: 'delete'
  })
}

export function getUserByTodoId(todoId) {
  return request({
    url: '/system/todo/' + todoId + '/user',
    method: 'get'
  })
}
